package com.example.asus.shixun2.SQL;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by ASUS on 2019/1/6.
 */

public class DBOpenHelper extends SQLiteOpenHelper {

    final String CREAD_TABLE_SQL="create table login(username varchar(20),password varchar(20))"; //定义创建数据库表的语句

    public DBOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, null, version);

    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.e("ds","sdf");
        db.execSQL(CREAD_TABLE_SQL);//创建数据表
        if (db!=null){
            Log.e("ds","sdf");
        }
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        Log.i("信息","--更新信息" + oldVersion + "-->" + newVersion);
    }

}
